package com.block.datapush.service.apipush.utils;

import cn.hutool.core.util.StrUtil;
import com.block.common.enums.BaseTypeInfoEnum;
import org.apache.commons.lang3.StringUtils;

/**
 * 金耀花-分润 双授权
 */
public class JinYaoHuaRateUtil {

    public static String getBaoxian(String baoxian) {
        if (StrUtil.equals(BaseTypeInfoEnum.Baoxian.bx001.getValue(), baoxian)) {
            return "bd001";
        }else if (StrUtil.equals(BaseTypeInfoEnum.Baoxian.bx002.getValue(), baoxian)){
            return "bd002";
        }
        return "bd004";
    }

    public static String getYongTu(String yongtu) {
        if (StrUtil.equals(BaseTypeInfoEnum.Yongtu.yt002.getValue(), yongtu)) {
            return "pu001";
        } else if (StrUtil.equals(BaseTypeInfoEnum.Yongtu.yt001.getValue(), yongtu)) {
            return "pu003";
        } else if (StrUtil.equals(BaseTypeInfoEnum.Yongtu.yt005.getValue(), yongtu)) {
            return "pu004";
        }else if (StrUtil.equals(BaseTypeInfoEnum.Yongtu.yt003.getValue(), yongtu)) {
            return "pu005";
        }else if (StrUtil.equals(BaseTypeInfoEnum.Yongtu.yt004.getValue(), yongtu)) {
            return "pu006";
        }
        return "pu003";
    }

    public static String getEnterpriseOwner(String enterpriseOwner) {
        if (StrUtil.equals(BaseTypeInfoEnum.Gongzuo.gz002.getValue(), enterpriseOwner)){
            return "eo002";
        }
        return "eo001";
    }

    //公积金
    public static String getGongJiJin(String gongjijin) {
        if (StrUtil.equals(BaseTypeInfoEnum.Gjj.gjj001.getValue(), gongjijin)) {
            return "gjj001";
        }else if (StrUtil.equals(BaseTypeInfoEnum.Gjj.gjj002.getValue(), gongjijin)) {
            return "gjj002";
        }
        return "gjj004";
    }

    //社保
    public static String getSheBao(String shebao) {
        if (StrUtil.equals(BaseTypeInfoEnum.Shebao.sb001.getValue(), shebao)) {
            return "sb001";
        }else if (StrUtil.equals(BaseTypeInfoEnum.Shebao.sb002.getValue(), shebao)) {
            return "sb002";
        }
        return "sb004";
    }

    //收入
    public static String getShouru(String shouru) {
        if (StrUtil.equals(BaseTypeInfoEnum.Shouru.sr001.getValue(), shouru)) {
            return "sa001";
        } else if (StrUtil.equals(BaseTypeInfoEnum.Shouru.sr002.getValue(), shouru)) {
            return "sa002";
        }
        return "sa003";
    }

    public static String getYuQi(String yuqi) {
        if (StrUtil.equals(BaseTypeInfoEnum.Yuqi.yq001.getValue(), yuqi)) {
            return "yq001";
        } else if (StrUtil.equals(BaseTypeInfoEnum.Yuqi.yq002.getValue(), yuqi) || StrUtil.equals(BaseTypeInfoEnum.Yuqi.yq003.getValue(), yuqi)) {
            return "yq002";
        } else if (StrUtil.equals(BaseTypeInfoEnum.Yuqi.yq004.getValue(), yuqi)){
            return "yq003";
        }
        return "yq004";
    }

    public static String getHouse(String house) {
        if (StrUtil.equals(BaseTypeInfoEnum.House.hu001.getValue(), house)) {
            return "hu001";
        }else if (StrUtil.equals(BaseTypeInfoEnum.House.hu002.getValue(), house)){
            return "hu003";
        }
        return "hu002";
    }

    public static String getloan(String loan) {
        if (StrUtil.equals(BaseTypeInfoEnum.LoanAmount.la001.getValue(), loan) || StrUtil.equals(BaseTypeInfoEnum.LoanAmount.la002.getValue(), loan)) {
            return "la001";
        } else if (StrUtil.equals(BaseTypeInfoEnum.LoanAmount.la003.getValue(), loan)) {
            return "la002";
        }
        return "la003";
    }

    public static String getloanTime(String loanTime) {
        if (StrUtil.equals(BaseTypeInfoEnum.LoanTime.lt001.getValue(), loanTime) || StrUtil.equals(BaseTypeInfoEnum.LoanTime.lt002.getValue(), loanTime)) {
            return "lt001";
        } else if (StrUtil.equals(BaseTypeInfoEnum.LoanTime.lt003.getValue(), loanTime)) {
            return "lt002";
        }
        return "lt003";
    }

    //学历
    public static String getEducation(String education) {
        if (StrUtil.equals(BaseTypeInfoEnum.XueLi.xl001.getValue(), education)) {
            return "xl001";
        } else if (StrUtil.equals(BaseTypeInfoEnum.XueLi.xl002.getValue(), education)) {
            return "xl002";
        }else if (StrUtil.equals(BaseTypeInfoEnum.XueLi.xl003.getValue(), education)) {
            return "xl003";
        }else if (StrUtil.equals(BaseTypeInfoEnum.XueLi.xl004.getValue(), education)) {
            return "xl004";
        }
        return "xl005";
    }

    //芝麻分
    public static String getZhimaScore(String zhima) {
        if (StrUtil.equals(BaseTypeInfoEnum.Zhima.zm001.getValue(), zhima)) {
            return "zm001";
        } else if (StrUtil.equals(BaseTypeInfoEnum.Zhima.zm002.getValue(), zhima)) {
            return "zm002";
        } else if (StrUtil.equals(BaseTypeInfoEnum.Zhima.zm003.getValue(), zhima)) {
            return "zm003";
        } else if (StrUtil.equals(BaseTypeInfoEnum.Zhima.zm004.getValue(), zhima)) {
            return "zm004";
        }
        return "zm005";
    }

    public static String getCar(String car) {
        if (StrUtil.equals(BaseTypeInfoEnum.Car.car001.getValue(), car)) {
            return "car001";
        }else if (StrUtil.equals(BaseTypeInfoEnum.Car.car002.getValue(), car)){
            return "car003";
        }
        return "car002";
    }

    public static String getReqIp(String ip){
        if (StringUtils.isNotEmpty(ip)){
            return ip;
        }
        return "127.0.0.1";
    }

    //职业
    public static String getJob(String job) {
        if (StrUtil.equals(BaseTypeInfoEnum.Gongzuo.gz001.getValue(), job)) {
            return "job001";
        } else if (StrUtil.equals(BaseTypeInfoEnum.Gongzuo.gz002.getValue(), job)) {
            return "job002";
        } else if (StrUtil.equals(BaseTypeInfoEnum.Gongzuo.gz003.getValue(), job)) {
            return "job003";
        }
        return "job004";
    }


}
